package com.vanguard.controller;

import com.vanguard.commons.base.BaseController;
import com.vanguard.commons.constant.CommonReturnCode;
import com.vanguard.commons.pojo.ResponseResult;
import com.vanguard.domain.Project;
import com.vanguard.service.IProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Title: 项目前端控制器
 * @Description:
 * @Author: vanguard
 * @Version: 1.0
 * @Date: 2018/11/18
 */
@Controller
@RequestMapping("project")
public class ProjectController extends BaseController {

    @Autowired
    private IProjectService projectService;

    /**
     * ajax查询项目列表集合
     * @return
     */
    @GetMapping("/getProjectList")
    @ResponseBody
    public Object projectList() {
        List<Project> projectList = projectService.getProjectList();
        return new ResponseResult(CommonReturnCode.OK, projectList);
    }
}
